package com.astoolkit.workflow.common
{
	import com.astoolkit.workflow.BaseTask;

	public class CheckEquality extends BaseTask
	{
		public var sourceObject : Object;
		public var sourceProperty : Object;
		public var sourceValue : Object;

		public var destinationObject : Object;
		public var destinationProperty : Object;
		public var destinationValue : Object;


		override public function begin() : void
		{
			super.begin();
			if( !this.sourceValue )
				this.sourceValue = ( this.sourceObject && this.sourceProperty && ( this.sourceObject.hasOwnProperty( this.sourceProperty ))) ? this.sourceObject[ this.sourceProperty ] : null;


			if( !this.destinationValue )
				this.destinationValue = ( this.destinationObject && this.destinationProperty && ( this.destinationObject.hasOwnProperty( this.destinationProperty ))) ? this.destinationObject[ this.destinationProperty ] : null;


			if( sourceValue == destinationValue )
				complete();
			//else
			//fail( 'Assertion failed' );
		}
	}
}